
<div class="wrapper-md ng-scope">
<div class="row" novalidate>

  <!--表结构 -->
  <div class="col-md-12">
    <div class="panel panel-default">


    <ul id="myTab" class="nav nav-tabs">
    <li class="active"><a href="#createuser1" data-toggle="tab">机构列表</a></li>
  <!--  <li ><a href="#home" data-toggle="tab">
      用户列表2</a>
   </li> -->
  <!--  <li><a href="#createuser" data-toggle="tab">机构创建</a></li> -->
   
    <!-- <li><a href="#changepass" data-toggle="tab">修改密码</a></li> -->
</ul>
<div id="myTabContent" class="tab-content">

  <div class="tab-pane fade in active" id="createuser1">
           
           <div class="panel-body">
                <div class="row">
                        <div class="col-sm-1">

                        </div>
                        <div class="col-sm-10">
                        <!--  <div class="row wrapper" >
                           <button  class="btn m-b-xs btn-success btn-xs btn-rounded" style="height:40px" ng-click="createstb()">
                              创建新机构
                            </button>
                            <button class="btn m-b-xs btn-success btn-xs btn-rounded" style="height:40px" ng-click="create()">
                              创建新用户
                            </button>

                            </div> -->
                      <button class="btn m-b-xs w-xs btn-success btn-rounded pull-right" ng-click="createstb()">机构创建</button>
       
                                <table class="table table-bordered">
                                    <thead>
                                      <tr>
                                        <th class="col-md-1 text-center">序号</th>
                                        <th class="col-md-3 text-center">机构编号</th>
                                        <th class="col-md-4 text-center">机构名称</th>
                                        <th class="col-md-2 text-center">登录账号</th>
                                        <th class="col-md-2 text-center">操作</th>
                                      </tr>
                                    </thead>
                                    <tbody>
                                      <tr ng-repeat="obj in objs">
                                        <td class="text-center">{{$index+1}}</td>
                                        <td class="text-center">{{obj.id}}</td>
                                        <td class="text-center">{{obj.name}}</td>
                                        <td class="text-center">{{obj.code}}</td>
                                        <td class="text-center">
                                          <a ng-click="updateinformation(obj)" class="btn btn-primary btn-xs"   ng-show="obj.flag"
                                          >编辑</a>
                                         <!--   <a ng-click="information(obj)" class="btn btn-info btn-xs"
                                          >详情</a> -->
                                        </td>
                                      </tr>
                                    </tbody>
                              </table>
                        </div>
                        <div class="col-sm-1"></div>
                   </div>
              </div>
       </div>
   <div class="tab-pane fade " id="home">
     <div class="row wrapper" >

            <div class="col-sm-3">
             

              <div class="input-group">
            <span class="input-group-addon" id="basic-addon1">单位名称</span>
            <input type="text" class="form-control" ng-model="searchform.name" aria-describedby="basic-addon1">
       </div>
            </div>
            <div class="col-sm-3">
              
         <div class="input-group">
          <span class="input-group-addon" id="basic-addon1">用户类别</span>
             <select name="" id="" ng-model="searchform.type"  class="form-control" style="width:120px">
                <option value="">未选择</option>
                <option value="1">景区</option>
                <option value="2">酒店</option>

            </select>
       </div>
            </div>
            <button class="btn m-b-xs w-xs btn-success btn-rounded" ng-click="pageChanged()">搜索</button>
            <!--  <button class="btn m-b-xs w-xs btn-primary pull-right btn-rounded" ng-click="load()" >创建用户</button> -->
          </div>

          <div class="panel-body">
            <table class="table table-striped table-bordered ng-isolate-scope dataTable no-footer" 
              style="display: table; width: 100%;table-layout:fixed;">
              <thead>
                <tr>
                  <th style="width: 12%;text-align:center;">单位编号</th>
                  <th style="width: 16%;text-align:center;">单位名称</th>
                  <th style="width: 10%;text-align:center;">所在区县</th>  
                  <th style="width: 8%;text-align:center;">登录账号</th>
                  <th style="width: 8%;text-align:center;">主要负责人(法人)</th>
                  <th style="width: 10%;text-align:center;">主要负责人电话</th>
                  <th style="width: 6%;text-align:center;">操作</th>
                </tr>
              </thead>
              <tbody>
                <tr ng-repeat="info in userList">
                  <td >{{info.id}}</td>
                  <td >{{info.name}}</td>
                  <td >{{info.place}}</td>  
                  <td >{{info.loginname}}</td>
                  <td >{{info.responsible_person}}</td>
                  <td >{{info.responsible_person_phone}}</td>                     
                  <td style="text-align:center;">
                 <!--    <button type="button" class="btn btn-info btn-xs" ng-click="information(info)">详情</button> -->
                    <button type="button" class="btn btn-primary btn-xs" ng-click="updateinformation(info)">编辑</button>
                   <!--   <button type="button" class="btn btn-danger btn-xs" ng-click="deleteUserInfo(info)">删除</button> -->
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
     
           <div class="text-right" style="background-color: white">
            <pagination 
                total-items="totalItems" 
                ng-model="currentPage" 

                ng-change="pageChanged()"
                previous-text="上一页"
                next-text="下一页"
                first-text="首页"
                last-text="尾页"
                max-size="5"
                boundary-links="true"
                rotate="false"

                items-per-page="itemsPerPage"
                class="m-t-none m-b"></pagination>


            </div>
   </div>
   <div class="tab-pane fade" id="createuser">
      <div class="panel-body">
            <form name="form1" class="form-horizontal form-validation ng-pristine ng-valid ng-valid-required">
             
              <div class="form-group">
                <label class="col-lg-3 control-label">单位名称:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="必填,用户创建后单位名称不能修改,请核准后填写" ng-change="mychange()" ng-model="obj.name" required="">
                </div>
               <!--  <label class="col-lg-3 control-label"   ng-show="biaoshi" style="text-align: left;color:red">请填写单位名称</label>    --> 
              </div>
               
              <div class="form-group">
                <label class="col-lg-3 control-label">所在区县:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="必填" ng-model="obj.place" required="">
                </div>
              </div>
               <div class="form-group">
                <label class="col-lg-3 control-label">登录账号:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="创建用户后自动生成"  required="" disabled="true">
                </div>
              </div>
                <div class="form-group">
                <label class="col-lg-3 control-label">初始登录密码:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="000000"  required="" disabled="true">
                </div>
              </div>
               <div class="form-group">
                <label class="col-lg-3 control-label">用户类别:</label>
                <div class="col-lg-5">
                  <select ng-model="obj.type" class="form-control" >
                    <option value="">请选择</option>
                    <option value="1">景区</option>
                    <option value="2">酒店</option>
                    <option value="3">旅游局</option>  
                  </select>
                </div>
              </div>
           
            
              <div class="form-group">
                <label class="col-lg-3 control-label" >主要负责人（法人）:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="必填" ng-model="obj.responsible_person" required="">
                </div>
              
              </div>
              <div class="form-group">
                <label class="col-lg-3 control-label">联系电话:</label>
                <div class="col-lg-5">
                  <input type="text" class="form-control" placeholder="必填" ng-model="obj.responsible_person_phone" required="">
                </div>
              </div>

            </form>


            <div class="col-lg-3"></div>
            <div class="col-lg-4">
              <button class="btn btn-primary btn-rounded" ng-click="addUser(obj)">添加</button>
              <button class="btn btn-default btn-rounded" ng-click="cancel()">取消</button>
            </div>
             
          </div>

     </div>
     
      


        <div class="tab-pane fade" id="changepass">

            

                  <div class=" col-md-6  col-md-offset-3 mt10">
                  <div class="panel panel-success">
                    <div class="panel-heading  ">修改密码</div>

                    <div class="panel-body">
                      <form class="form-horizontal">

                        <div class="form-group mt10 input-lg">
                          <div class="col-sm-3 control-label">旧密码</div>
                          <div class="col-sm-9">
                            <input type="password" class="form-control" ng-model="pass.oldPassword" placeholder="输入旧密码">
                          </div>
                        </div>

                        <div class="form-group mt10 input-lg">
                          <div class="col-sm-3 control-label">新密码</div>
                          <div class="col-sm-9">
                            <input type="password" class="form-control" ng-model="pass.newPassword" placeholder="输入新密码">
                          </div>
                        </div>

                        <div class="form-group mt10 input-lg" >
                          <div class="col-sm-3 control-label">确认新密码</div>
                          <div class="col-sm-9">
                            <input type="password" class="form-control" ng-model="pass.newPassword2" placeholder="确认新密码">
                          </div>
                        </div>

                        <div class="form-group input-lg">

                          <div class="col-sm-12">
                            <button type="button" 
                            class="btn btn-success btn-block"
                            ng-click="gogo()">确定</button>
                          </div>
                        </div>

                        <div class="alert alert-warning" role="alert">初始密码'000000'</div>
                        
                      </form>
                    </div>
                  </div>
                  </div>


      </div>
   </div>
     

    </div>
  </div>
</div>
</div>


